<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>情绪识别小镜子</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="app-container">
        <header class="header">
            <h1>🪞 情绪识别小镜子</h1>
            <p>让我看看你的心情吧！</p>
        </header>

        <main class="main-content">
            <!-- 镜子区域 -->
            <section class="mirror-section">
                <div class="mirror-container">
                    <video id="videoElement" autoplay muted></video>
                    <canvas id="overlayCanvas" class="overlay"></canvas>
                    <div class="mirror-frame"></div>
                </div>
                
                <!-- 情绪状态显示 -->
                <div class="emotion-display">
                    <div class="emotion-icon" id="emotionIcon">😊</div>
                    <div class="emotion-text" id="emotionText">准备中...</div>
                </div>
            </section>

            <!-- 互动区域 -->
            <section class="interaction-section">
                <div class="response-box" id="responseBox">
                    <div class="avatar">🤖</div>
                    <div class="message" id="aiMessage">
                        嗨！我是你的情绪小助手，你可以对着镜子做表情，或者告诉我你的心情！
                    </div>
                </div>

                <!-- 控制按钮 -->
                <div class="controls">
                    <button id="startCamera" class="btn btn-primary">
                        📸 打开镜子
                    </button>
                    <button id="startVoice" class="btn btn-secondary">
                        🎤 说话给我听
                    </button>
                    <button id="tellStory" class="btn btn-story">
                        📖 听故事
                    </button>
                </div>
            </section>

            <!-- 历史记录 -->
            <section class="history-section">
                <h3>今天的心情记录</h3>
                <div class="emotion-timeline" id="emotionTimeline">
                    <!-- 动态添加情绪记录 -->
                </div>
            </section>
        </main>

        <!-- 加载提示 -->
        <div class="loading-overlay" id="loadingOverlay">
            <div class="loading-spinner"></div>
            <p>正在准备小镜子...</p>
        </div>
    </div>

    <!-- 音频元素 -->
    <audio id="notificationSound" preload="auto">
        <source src="sounds/notification.mp3" type="audio/mpeg">
    </audio>

    <!-- JavaScript 库 -->
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/face-landmarks-detection@latest"></script>
    <script src="app.js"></script>
</body>
</html>